package com.jlsoft.code;

/**
 * 系统枚举类型
 */

public enum UseFlag {
    /**
     * 数据可用标识
     * available 可用
     * disable 禁用
     */
    AVAILABLE(1, "可用"), DISABLE(0, "禁用");

    private Integer code;
    private String  desc;
    private UseFlag(Integer code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static UseFlag getUseFlag(Integer code){
        switch (code) {
            case  1:
                return AVAILABLE;
            case  2:
                return DISABLE;
            default:
                return AVAILABLE;
        }
    };

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
